package ezcaptcha

import "github.com/imroc/req/v3"

type TaskTypeRecaptchaV2 string

const (
	TaskTypeRecaptchaV2Proxyless            TaskTypeRecaptchaV2 = "ReCaptchaV2TaskProxyless"
	TaskTypeRecaptchaV2ProxylessS9          TaskTypeRecaptchaV2 = "ReCaptchaV2TaskProxylessS9"
	TaskTypeRecaptchaV2SProxyless           TaskTypeRecaptchaV2 = "ReCaptchaV2STaskProxyless"
	TaskTypeRecaptchaV2EnterpriseProxyless  TaskTypeRecaptchaV2 = "ReCaptchaV2EnterpriseTaskProxyless"
	TaskTypeRecaptchaV2SEnterpriseProxyless TaskTypeRecaptchaV2 = "ReCaptchaV2SEnterpriseTaskProxyless"
)

// TaskRecaptchaV2C https://ezcaptcha.atlassian.net/wiki/spaces/IS/pages/196932/ReCaptcha+V2
type TaskRecaptchaV2C struct {
	Type         TaskTypeRecaptchaV2 `json:"type"`
	WebsiteURL   string              `json:"websiteURL"`
	WebsiteKey   string              `json:"websiteKey"`
	IsInvisible  bool                `json:"isInvisible"`
	SA           string              `json:"sa,omitempty"`
	S            string              `json:"s,omitempty"`
	WebSiteTitle string              `json:"websiteTitle,omitempty"`
	Proxy        string              `json:"proxy,omitempty"`
}

// TaskRecaptchaV2R https://ezcaptcha.atlassian.net/wiki/spaces/IS/pages/196932/ReCaptcha+V2
type TaskRecaptchaV2R struct {
	GRecaptchaResponse string `json:"gRecaptchaResponse"`
}

type (
	ClientRecaptchaV2  = Client[TaskRecaptchaV2C, TaskRecaptchaV2R]
	OptionsRecaptchaV2 = Option[TaskRecaptchaV2C, TaskRecaptchaV2R]
)

func NewClientForRecaptchaV2(httpClient *req.Client, clientKey string, opts ...OptionsRecaptchaV2) *ClientRecaptchaV2 {
	return NewClient(httpClient, clientKey, opts...)
}
